fn main() {
    println!("Hello, world!");
    let mut s1 = String::from("hello");

    let r2 = dangle();
    println!("{}.", r2.len());

    let r1 = &mut s1;
    let len1 = calc_length(r1);
    println!("{}.", len1);
}

fn calc_length(s: &mut String) -> usize {
    s.push_str("aaa");
    s.len()
}

fn dangle() -> String {
    let s = String::from("dangle");
    s
}